﻿<Window x:Class="SolickManagerV3_4.Windows.ListAddAssemblyWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SolickManagerV3_4.Windows"
        mc:Ignorable="d"
        Icon="Images/SolulCompIcon.ico"
        WindowStartupLocation="CenterOwner"
        Title="SoulComp Manager" Height="640" Width="980">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>

        <Grid Margin="0 0 0 25">

            <Grid>
                <Border Background="White"
                        CornerRadius="10"
                        MinWidth="940"
                        MinHeight="580"
                        BorderThickness="0"
                        Margin="20 25 10 00"
                        Padding="0 20 0 0">

                    <DataGrid x:Name="DataGridAssemblies"
                              Style="{DynamicResource DataGridSolickStyle}" 
                              AutoGenerateColumns="False" 
                              HeadersVisibility="Column"
                              IsReadOnly="true"
                              ItemsSource="{Binding Assemblies}"
                              SelectedItem="{Binding SelectedAssembly}"
                              HorizontalAlignment="Left"
                              MinWidth="940"
                              Width="auto"
                              Height="auto"
                              HorizontalGridLinesBrush="Transparent"
                              VerticalGridLinesBrush="Transparent">
                        <DataGrid.ColumnHeaderStyle>
                            <Style TargetType="{x:Type DataGridColumnHeader}">
                                <Setter Property="Background" Value="#3993DD"/>
                                <Setter Property="Foreground" Value="White"/>
                                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="Padding" Value="5 1"/>
                            </Style>
                        </DataGrid.ColumnHeaderStyle>
                        <DataGrid.CellStyle>
                            <Style TargetType="{x:Type DataGridCell}">
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="VerticalAlignment" Value="Center"/>
                                <Setter Property="FontFamily" Value="Inter"/>
                                <Setter Property="FontSize" Value="11"/>

                                <Style.Triggers>
                                    <Trigger Property="IsSelected" Value="True" >
                                        <Setter Property="Background" Value="#24FFE9" />
                                        <Setter Property="Foreground" Value="Black" />

                                        <Setter Property="BorderThickness" Value="0"/>
                                    </Trigger>

                                    <Trigger Property="IsMouseOver" Value="True">
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </DataGrid.CellStyle>
                        <DataGrid.RowStyle>
                            <Style TargetType="{x:Type DataGridRow}">
                                <Setter Property="BorderThickness" Value="0"/>
                                <Setter Property="Background" Value="White"/>
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="FontFamily" Value="Inter"/>
                                <Setter Property="FontSize" Value="11"/>

                                <Style.Triggers>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="Background" Value="#24FFE9"/>
                                        <Setter Property="Foreground" Value="Black"/>
                                    </Trigger>

                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Background" Value="#B5FFF8" />
                                        <Setter Property="Foreground" Value="Black" />

                                        <Setter Property="BorderThickness" Value="0"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </DataGrid.RowStyle>
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="50*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Код" Binding="{Binding Id}"/>
                            <DataGridTextColumn Width="70*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Дата" Binding="{Binding DataView}"/>
                            <DataGridTextColumn Width="100*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Название" Binding="{Binding Title}"/>
                            <DataGridTextColumn Width="140*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Мастера" Binding="{Binding MastersView}"/>
                            <DataGridTemplateColumn Width="400*" Header="Товары">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <ListView ItemsSource="{Binding Products}">
                                            <ListView.View>
                                                <GridView>
                                                    <GridViewColumn Header="Модель" DisplayMemberBinding="{Binding Model}"/>
                                                    <GridViewColumn Header="Количество" DisplayMemberBinding="{Binding Amount}"/>
                                                    <GridViewColumn Header="Стоимость единицы" DisplayMemberBinding="{Binding Cost}"/>
                                                </GridView>
                                            </ListView.View>
                                        </ListView>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                            <DataGridTextColumn Width="80*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Стоимость" Binding="{Binding CostView}"/>
                        </DataGrid.Columns>
                        <DataGrid.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Добавить" Click="AddAssembly"/>
                            </ContextMenu>
                        </DataGrid.ContextMenu>
                    </DataGrid>
                </Border>

                <Grid Height="34" VerticalAlignment="Top" Margin="20 5 10 0">
                    <Label Content="Сборки и группы товаров" 
                           FontFamily="Assets/Inter/#Inter-V.ttf"
                           FontSize="22"
                           Margin="10 0 0 0"
                           HorizontalAlignment="Left"/>
                    <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                        <TextBlock Text="Поиск"
                                   FontSize="16"
                                   VerticalAlignment="Bottom"
                                   Margin="0 0 10 0"
                                   FontFamily="Inter"
                                   FontWeight="Medium"/>
                        <TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
                                 Style="{DynamicResource RoundTextBox}"
                                 Height="24"
                                 VerticalAlignment="Bottom"
                                 FontSize="14"
                                 FontFamily="Inter"
                                 FontWeight="Light"
                                 Width="140"
                                 BorderThickness="1"/>
                    </StackPanel>
                </Grid>
            </Grid>

        </Grid>
    </Grid>
</Window>
